<h1 align="center">Cat&aacute;logo de Asignaturas</h1>
<div class="area" align="center">
<?php
	//echo $this->Form->create();
    //echo $this->Form->input('Nombre asignatura');
    //echo $this->Form->end('Buscar');

   	echo $this->Form->create();
    echo $this->Form->input('Ciclo');
   // echo $this->$Form->input('Ciclo',array('options'=>array(1,2,3)));
    echo $this->Form->end('Buscar');
?>
</div>
</br>
<div class="area" align="center">

  <table>
    <tr>
      <th width="45">C&oacute;digo</th>
      <th width="72">Departamento</th>
      <th width="130">Nombre de la asignatura</th>
	  <th width="30">Unidades valorativas</th>
      <th width="45">Prerequisito</th>
      <th width="45">Tipo Asignatura</th>
      <th width="20">Ciclo</th>
      <th width="45">Programa</th>
      <th width="45">Accion</th>
      </tr>
    
    <!-- Here is where we loop through our $posts array, printing out post info -->
    
    <?php foreach ($Asignaturas as $asignatura): ?>
    <tr>
      <td><div align="center"><?php echo $asignatura[0]['idasignatura']; ?></div></td>
      <td><div align="left"><?php echo $asignatura[0]['nombredepto']; ?></div></td>
	  <td><div align="left"><?php echo $asignatura[0]['nombreasignatura']; ?></div></td>
	  <td><div align="center"><?php echo $asignatura[0]['uval']; ?></div></td>
      <td><div align="left"><?php echo $asignatura[0]['prerrequisito']; ?></div></td>
      <td><div align="left"><?php echo $asignatura[0]['tipoasig']; ?></div></td>
      <td><div align="center"><?php echo $asignatura[0]['nciclo']; ?></div></td>
      <td><div align="center"><a target="_blank" href="<?php echo $asignatura[0]['programaurl']; ?>">Ver</a></div></td>
      <td><div align="left">
        <?php echo $this->Html->link('Editar', array('action' => 'editar', $asignatura[0]['idasignatura']));?></br>
        <?php if($asignatura[0][0]['count']==0){echo $this->Form->postLink('Eliminar', array('action' => 'eliminar', $asignatura[0]['idasignatura']), array('confirm' => 'Esta seguro?'));} ?>
     </div></td>
     </tr>
    <?php endforeach; ?>
    
  </table>
  
 </div>
</br>
<div class="area" align="left">
<?php echo $this->Html->link('Crear asignatura', array('action' => 'crear'));?>
</div>
</br>